package com.ruoyi.wms.mapper;

import java.util.List;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.wms.domain.WmsInventoryAllocation;

/**
 * 库存分配Mapper接口
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
public interface WmsInventoryAllocationMapper 
{
    /**
     * 查询库存分配
     * 
     * @param allocationId 库存分配主键
     * @return 库存分配
     */
    public WmsInventoryAllocation selectWmsInventoryAllocationById(Long allocationId);

    /**
     * 查询库存分配列表
     * 
     * @param wmsInventoryAllocation 库存分配
     * @return 库存分配集合
     */
    public List<WmsInventoryAllocation> selectWmsInventoryAllocationList(WmsInventoryAllocation wmsInventoryAllocation);

    /**
     * 根据明细ID查询分配列表
     * 
     * @param detailId 明细ID
     * @return 库存分配集合
     */
    public List<WmsInventoryAllocation> selectWmsInventoryAllocationByDetailId(Long detailId);

    /**
     * 根据出库单ID查询分配列表
     * 
     * @param orderId 出库单ID
     * @return 库存分配集合
     */
    public List<WmsInventoryAllocation> selectWmsInventoryAllocationByOrderId(Long orderId);

    /**
     * 新增库存分配
     * 
     * @param wmsInventoryAllocation 库存分配
     * @return 结果
     */
    public int insertWmsInventoryAllocation(WmsInventoryAllocation wmsInventoryAllocation);

    /**
     * 修改库存分配
     * 
     * @param wmsInventoryAllocation 库存分配
     * @return 结果
     */
    public int updateWmsInventoryAllocation(WmsInventoryAllocation wmsInventoryAllocation);

    /**
     * 删除库存分配
     * 
     * @param allocationId 库存分配主键
     * @return 结果
     */
    public int deleteWmsInventoryAllocationById(Long allocationId);

    /**
     * 批量删除库存分配
     * 
     * @param allocationIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWmsInventoryAllocationByIds(Long[] allocationIds);

    /**
     * 根据明细ID删除分配记录
     * 
     * @param detailId 明细ID
     * @return 结果
     */
    public int deleteWmsInventoryAllocationByDetailId(Long detailId);

    /**
     * 根据出库单ID删除分配记录
     * 
     * @param orderId 出库单ID
     * @return 结果
     */
    public int deleteWmsInventoryAllocationByOrderId(Long orderId);

    /**
     * 批量新增库存分配
     * 
     * @param allocationList 库存分配列表
     * @return 结果
     */
    public int batchInsertWmsInventoryAllocation(@Param("list") List<WmsInventoryAllocation> allocationList);

    /**
     * 更新已拣货数量
     * @param allocationId 分配ID
     * @param pickedQty 已拣货数量
     * @param updateBy 更新者
     * @return 结果
     */
    public int updatePickedQty(@Param("allocationId") Long allocationId, @Param("pickedQty") BigDecimal pickedQty, @Param("updateBy") String updateBy);



    /**
     * 更新分配状态
     * 
     * @param allocationId 分配ID
     * @param allocationStatus 分配状态
     * @param updateBy 更新人
     * @return 结果
     */
    public int updateAllocationStatus(@Param("allocationId") Long allocationId, @Param("allocationStatus") String allocationStatus, @Param("updateBy") String updateBy);

    /**
     * 批量更新分配状态
     * 
     * @param detailId 明细ID
     * @param allocationStatus 分配状态
     * @param updateBy 更新人
     * @return 结果
     */
    public int batchUpdateAllocationStatusByDetailId(@Param("detailId") Long detailId, @Param("allocationStatus") String allocationStatus, @Param("updateBy") String updateBy);
}